package com.rizhov.main;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Server {

    /** common collection for all the users */
    protected static List<String> colleciton = Collections
	    .synchronizedList(new ArrayList<String>());

    /** id counter */
    protected static int currentId = 0;

    /**
     * @param args
     */
    public static void main(String[] args) {
	while (true) {
	    try {
		ServerSocket ss = new ServerSocket(4444);
		while (true) {
		    new ClientHandler(currentId++, ss.accept());
		}
	    } catch (UnknownHostException e) {
		e.printStackTrace();
	    } catch (IOException e) {
		e.printStackTrace();
	    }
	}
    }

}
